﻿Imports System.Data
Imports Mysoft.Map.Data

Partial Public Class Cwjk_Project_Edit
    Inherits Mysoft.Map.Application.Security.AppPage

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        If Not IsPostBack Then

            Dim strCwztGUID As String = ""
            Dim strCwztName As String = ""
            Dim strBUGUID As String = ""
            Dim strModeType As String = ""

            If Request.QueryString("CwztGUID") <> Nothing AndAlso Request.QueryString("CwztGUID").ToString() <> "" Then
                strCwztGUID = Request.QueryString("CwztGUID").ToString()
            End If

            If Request.QueryString("CwztName") <> Nothing AndAlso Request.QueryString("CwztName").ToString() <> "" Then
                strCwztName = Request.QueryString("CwztName").ToString()
            End If

            If Session("BUGUID") <> Nothing AndAlso Session("BUGUID").ToString() <> "" Then
                strBUGUID = Session("BUGUID").ToString()
            End If

            If Request.QueryString("mode") <> Nothing AndAlso Request.QueryString("mode").ToString() <> "" Then
                strModeType = Request.QueryString("mode").ToString()
            End If

            If strModeType = "1" Then
                appForm.DefaultValueXml = InitFormXml(strCwztGUID, strBUGUID)
            End If

        End If

    End Sub

    '获取表单的初始化xml
    Private Function InitFormXml(ByVal strCwztGUID As String, ByVal strBUGUID As String) As String
        Dim sDefaultValueXml As String = ""
        '基本信息
        sDefaultValueXml = "<xml>" & _
                            "<BUGUID defaultvalue='" & strBUGUID & "' />" & _
                            "<CwztGUID defaultvalue='" & strCwztGUID & "' />" & _
                            "</xml>"

        Return sDefaultValueXml
    End Function

    Protected Overrides Sub ConfigureForm()
        appForm.Execute()
    End Sub

End Class
